#include <iostream>
#include "parser.h"
bool e()
{
    return feof(stdin);
}
int main()
{
    LEX lex(getchar, e);
    parser par(&lex);
    while (!e())
    {
        auto exp = par.parseExpr();
        std::cout << "Ans = " << exp->Calc() << " (is_const:" << exp->is_const() << ")" << std::endl;
        exp->Dump();
        std::cout << std::endl;
    }
    
    return 0;
}